package com.imooc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @Author lhy
 * @Date 2021/9/29 9:26
 */
@SpringBootApplication
@EnableDiscoveryClient
public class EurekaConsumerApplication {
    public static void main(String[] args) {
       new SpringApplicationBuilder(EurekaConsumerApplication.class)
               .web(WebApplicationType.SERVLET)
               .run(args);
    }

    @Bean(name = "RestTemplate")
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}
